package com.hzt.business.controller;

import com.hzt.business.domain.Salesback;
import com.hzt.business.service.SalesbackService;
import com.hzt.business.vo.SalesbackVo;
import com.hzt.system.common.ResultObj;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
*
* @Author:hzt
* @Date:6:52 下午 2020/7/25
*/
@RequestMapping("api/salesback")
@RestController
public class SalesbackController {

    @Autowired
    private SalesbackService salesbackService;


    @RequestMapping("loadAllSalesback")
    public Object loadAllSalesback(SalesbackVo salesbackVo){
        return this.salesbackService.queryAllSalesback(salesbackVo);
    }


    @RequestMapping("addSalesback")
    public ResultObj addSalesback(Salesback salesback){

        try {
            this.salesbackService.saveSalesback(salesback);
            return  ResultObj.ADD_SUCCESS;
        } catch (Exception e) {
            e.printStackTrace();
            return  ResultObj.ADD_SUCCESS;
        }
    }



}
